package com.yanjr.modules.ad.dao.impl;

import org.springframework.stereotype.Repository;

import com.yanjr.common.Constants;
import com.yanjr.common.persistence.BaseDaoImpl;
import com.yanjr.modules.ad.dao.AdvertisementDao;
import com.yanjr.modules.ad.entity.Advertisement;

@Repository("advertisementDao")
public class AdvertisementDaoImpl extends BaseDaoImpl<Advertisement> implements AdvertisementDao {

	@Override
	public int enableById(String id) {
		String sql = "update advertisement set is_enable=? where id=?";
		return super.update(sql, new Object[]{Constants.SHOW, id});
	}

	@Override
	public int disenableById(String id) {
		String sql = "update advertisement set is_enable=? where id=?";
		return super.update(sql, new Object[]{Constants.HIDE, id});
	}

}
